<extend name="Common/layout"/>

<block name="content">

    <div id="content">
        <div class="page-header">
            <div class="container-fluid">
                <div class="pull-right">
                    <button type="submit" form="form-brand" data-toggle="tooltip" title="保存" class="btn btn-primary"><i
                        class="fa fa-save"></i>
                    </button>
                    <a href="" data-toggle="tooltip" title="取消" class="btn btn-default"> <i class="fa fa-reply"></i>
                    </a>
                </div>
                <h1>商品品牌</h1>
                <ul class="breadcrumb">
                    <li>
                        <a href="{:U('Manage/index')}">首页</a>
                    </li>
                    <li>
                        <a href="{:U('list')}">商品品牌</a>
                    </li>
                </ul>
            </div>
        </div>
        <div class="container-fluid">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        <i class="fa fa-pencil"></i>
                        添加商品品牌
                    </h3>
                </div>
                <div class="panel-body">
                    <form action="{:U('crud', ['step'=>$step])}" method="post" enctype="multipart/form-data"
                          id="form-brand" class="form-horizontal">
                        <ul class="nav nav-tabs">
                            <li class="<if condition=" $step eq
                            'table'">active</if>">
                            <a href="#tab-table" data-toggle="tab">表信息</a>
                            </li>
                            <li class="<if condition=" $step eq
                            'field'">active</if>">
                            <a href="#tab-field" data-toggle="tab">字段信息</a>
                            </li>
                        </ul>
                        <div class="tab-content">
                            <div class="tab-pane <if condition=" $step eq
                            'table'">active</if>" id="tab-table">
                            <div class="form-group required">
                                <label class="col-sm-2 control-label" for="input-table">表名</label>
                                <div class="col-sm-10">
                                    <input type="text" name="table" value="{$data['table']}" placeholder="无前缀表名"
                                           id="input-table" class="form-control"/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label" for="input-title">表展示标题</label>
                                <div class="col-sm-10">
                                    <input type="text" name="title" value="{$data['title']}" placeholder="展示标题, 默认使用表名"
                                           id="input-title" class="form-control">
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane <if condition=" $step eq
                        'field'">active</if>" id="tab-field">
                        <div class="row">
                            <div class="col-sm-12">
                                <table id="table-field" class="table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <td class="text-left">字段</td>
                                        <td class="text-left">展示标题</td>
                                        <td class="text-center">是否设置</td>
                                        <td class="text-center">是否列表</td>
                                        <td class="text-center">是否排序</td>
                                        <td class="text-center">是否搜索</td>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <volist name="fieldList" id="field">
                                        <tr id="tr-field-title">
                                            <td class="text-left">
                                                {$field}
                                            </td>
                                            <td class="text-left">
                                                <input name="field[{$field}][title]" value="" placeholder="标题"
                                                       class="form-control" type="text">
                                            </td>
                                            <td class="text-center">
                                                <input type="checkbox" name="field[{$field}][is_set]" value="1" checked>
                                            </td>

                                            <td class="text-center">
                                                <input type="checkbox" name="field[{$field}][is_list]" value="1"
                                                       checked>
                                            </td>
                                            <td class="text-center">
                                                <input type="checkbox" name="field[{$field}][is_sort]" value="1"
                                                       checked>
                                            </td>
                                            <td class="text-center">
                                                <input type="checkbox" name="field[{$field}][is_search]" value="1"
                                                       checked disabled>
                                            </td>
                                        </tr>
                                    </volist>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    </div>
    </div>

</block>